<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"  > 
       
<h:head> 

<ui:include src="/vistas/default.xhtml"></ui:include>
<ui:param name="root" value="#{request.contextPath}/" />




</h:head> 

<body> 
<h:form id="frmLogger">
<p:messages id="messagesLog" autoUpdate="true" showDetail="true"/>

<p:growl id="growlLog" autoUpdate="true" showDetail="true"/>

<p:panel menuTitle="Tables">

            <f:facet name="header">
				<h:outputLabel value="CONSOLA DE LOGGER" />
			</f:facet>
			
<h:panelGrid columns="3" style="width:100%; padding-left: 50px; ">
   <p:graphicImage value="/images/log4j.jpg" /> 
<h:panelGrid columns="3">
<h:outputLabel value="Categoria :" />
<h:selectOneMenu id="cboLevel" value="#{log4MB.slogfilter.sLevel}">
<f:selectItems value="#{log4MB.lstLevel}" /> 
</h:selectOneMenu>


<h:panelGrid columns="1">
<a href="#{root}main/download/reportPDF.htm"  style="color:#0073EA;font-weight:bold; ">Download PDF</a><br/>
<a href="#{root}main/download/xlsReport.htm" style="color:#0073EA;font-weight:bold;">Download Xls</a>
</h:panelGrid>

<h:outputLabel value="Hilo - Thread :" />
<p:inputText id="txtThread" value="#{log4MB.slogfilter.sThread}" />

<p:commandButton value="Filtrar" style="width:80px; " id="btnFiltrar" icon="ui-icon-search" action="#{log4MB.filtrarLogger}" update="frmLogger:tblLoggers"  />
 
<h:outputLabel value="Logger :" />
<p:inputText id="txtLogger"  value="#{log4MB.slogfilter.sLogger}"/>
<p:commandButton value="Limpiar" icon="ui-icon-search" action="#{log4MB.limpiar}" update="frmLogger" />

<h:outputLabel value="Clase :" />
<p:inputText id="txtMensaje" value="#{log4MB.slogfilter.sMessage}" />
<h:outputLabel/>

<h:outputLabel value="Fecha Inicio :" />
<p:calendar id="txtFechaInicio" locale="es" pattern="dd/MM/yyyy" value="#{log4MB.slogfilter.sFInicio}"/>
<h:outputLabel/>

<h:outputLabel value="Fecha Fin :" />
<p:calendar id="txtFechaFin" locale="es" pattern="dd/MM/yyyy" value="#{log4MB.slogfilter.sFFin}"/>
<h:outputLabel/>


</h:panelGrid>

<h:panelGrid  columns="1">
 <p:fieldset legend="Cambiar Nivel del Logger"  >
     
	   <h:panelGrid columns="3">
	  
	 		    <h:outputLabel value="Nivel Logger :" />
				<p:selectOneMenu id="cboLevelCambio" value="#{log4MB.sValuePaquete}"  style="margin-left:30px;">
                     <f:selectItems value="#{log4MB.lstLevel}" /> 
                </p:selectOneMenu>
				<p:commandButton id="btnGrabar" value="Cambiar" icon="ui-icon-search"  action="#{log4MB.grabarNivelPaquete}"
                 style="margin-left:40px;"  />
	   </h:panelGrid> 
    </p:fieldset>
   <p:fieldset legend="Logger desde el Servidor"  >
     
	   <h:panelGrid columns="3">
	  
	 		    <h:outputLabel value="Url a descargar :" />
				<p:inputText id="txtDescarga"  value="#{log4MB.sPath}" size="50" />
				<p:commandButton value="Download" ajax="false" actionListener="#{log4MB.dowloadLogger}"
				onclick="PrimeFaces.monitorDownload(showStatus, hideStatus)" update="frmLogger:growlLog">
                <p:fileDownload contentDisposition="inline" value="#{log4MB.file}"/>
                </p:commandButton >
	   </h:panelGrid> 
    </p:fieldset>
</h:panelGrid> 
      
</h:panelGrid>


</p:panel>
<p:separator />

<p:panel menuTitle="Tables">
            <f:facet name="header">
				<h:outputLabel value="Resultado de la Busqueda" />
			</f:facet>
		
		 	<p:dataTable paginator="true"  rows="10" 
				style="width: 100%" var="log" id="tblLoggers"
				value="#{log4MB.lstLogger}" scrollable="true" scrollHeight="200"  
				emptyMessage="No se encuentran resultados"  
				paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                rowsPerPageTemplate="5,10,20">
		 	   
		 	   <p:column styleClass="item" >
					<f:facet name="header">
						<h:outputText value="Item"  />
					</f:facet>
					<h:outputText value="#{log.item}" />
				</p:column>
				<p:column styleClass="app">
					<f:facet name="header">
						<h:outputText value="APP"  />
					</f:facet>
					<h:outputText value="#{log.app}" />
				</p:column>
				<p:column styleClass="fecha">
					<f:facet name="header">
						<h:outputText value="Fecha" />
					</f:facet>
					<h:outputText value="#{log.fechastring}" />
				</p:column>
				<p:column styleClass="categoria" >
					<f:facet name="header">
						<h:outputText value="Categoria" />
					</f:facet>
					<h:outputText value="#{log.prioridad}" />
				</p:column>
				<p:column styleClass="thead">
					<f:facet name="header">
						<h:outputText value="Thead" />
					</f:facet>
					<h:outputText value="#{log.thead}" />
				</p:column>
				<p:column styleClass="clase_localizacion" >
					<f:facet name="header">
						<h:outputText value="Clase-Localizacion" />
					</f:facet>
					<h:outputText value="#{log.inflocalizacion}" />
				</p:column>
				<p:column styleClass="mensaje" >
					<f:facet name="header">
						<h:outputText value="Mensaje" />
					</f:facet>
					<h:outputText value="#{log.mensaje}" />
				</p:column>
				<p:column styleClass="throwable">
					<f:facet name="header">
						<h:outputText value="Throwable" />
					</f:facet>
					<h:outputText value="#{log.throwable}" />
				</p:column>
			
			 </p:dataTable>
			
</p:panel>

</h:form>
</body> 
</html>
